home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / exechk.arc / MYINSTAL.PAS < prev    next >
Pascal/Delphi Source File  |  1990-12-06  |  3KB  |  71 lines

  1. (*******************************************************************
  2. Program/Unit                 MYINSTAL.PAS
  3. Written                      06 Dec 90
  4. Revised                      .........
  5. Author                       Johnathan J. Stein
  6.                              PO Box 346
  7.                              Perrysburg, OH  43551
  8.                              CompuServe 76576,470
  9. Purpose                      To illustrate how to implement EXE
  10.                              file "stamping", in order to discourage
  11.                              illegal copying WITHOUT using copy protection.
  12. Contents
  13. --------
  14. Sample installation program, which uses "IsExePersonalized" to see if
  15. it is neccessary to do a first-time setup and "stamp" the EXE application
  16. program.
  17.  
  18. Both the installation and application program share data display routines.
  19. *******************************************************************)
  20. USES Crt,
  21.      exechk ;
  22.  
  23. CONST
  24.    MyInstallDrive            : string = 'A:\' ;
  25.    MyProgramName             : string = 'MYPROG.EXE' ;
  26.  
  27. {$I mydata.inc }                       (* Data Entry & Display *)
  28. {$I abort.inc }                        (* Global halt with message *)
  29.  
  30. procedure MyInstallExe ( S : string ) ;
  31. begin
  32.    if not IsDriveA ( ParamStr ( 0 ) ) then
  33.       Abort ( 'INSTALL must be run from drive A:' ) ;
  34.    MyDataInit ;
  35.    if IsExePersonalized ( S ) then               (* Do not let user change data! *)
  36.    begin
  37.       ExeReadData ( S ,
  38.                     Data ,
  39.                     SizeOf ( Data ) ) ;          (* Get from EXE file *)
  40.       MyDataOutput ;                             (* Display name, etc *)
  41.       EXIT ;
  42.    end ;
  43.    MyDataInput ;                                 (* Get input from USER *)
  44.    if not Ok then
  45.       Abort ( 'Installation cancelled!' ) ;      (* End program *)
  46.    ExeInstallData ( S ,
  47.                     Data ,
  48.                     SizeOf ( Data ) ) ;          (* Append to EXE file *)
  49. end ;
  50.  
  51. procedure MyMainInstall ;
  52. begin
  53.    writeln ( 'My Main Installation Procedure!' ) ;
  54. {
  55.    Put your custom install procedures here.
  56.    ----------------------------------------
  57.    MyCreateDir ;
  58.    MyCopyFiles ;
  59.    MyWhatEver ;
  60. }
  61. end ;
  62.  
  63. begin
  64.    writeln ( 'ABC Software Company' ) ;
  65.    writeln ( 'Installation Program for ' , MyProgramName ) ;
  66.    writeln ( '---------------------------------------------' ) ;
  67.    MyInstallExe ( MyInstallDrive + MyProgramName ) ;
  68.    FileMode                  := 2 ;              (* Reset to TP default *)
  69.    MyMainInstall ;
  70. end .
  71.